package lvm.view;


import java.awt.EventQueue;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import lvm.Contexte;

public class runIhm {

	private Display display;
	private Shell shell;
	public static runIhm window;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		window = new runIhm();
	}

	/**
	 * Create the application.
	 */
	public runIhm() {
		System.out.println(System.getProperty("os.name"));
		System.out.println(System.getProperty("os.arch"));
		System.out.println(System.getProperty("os.version"));
		initialize();
	}

	public void initContext(){
		ContexteView c = new ContexteView(shell,display);
		ContextesVariablesView.initContextesVaraiblesViews("Contexte Principale",Contexte.getContexteCourant(), display);
	}

	
	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		display = new Display();
		shell = new Shell(display,SWT.BORDER | SWT.BOTTOM | SWT.RESIZE |SWT.TOP);
		shell.setLayout(new FillLayout(SWT.VERTICAL));
		shell.setSize(300, 500);
		shell.setLocation(500, 20);
		shell.setText("Lvm LISP");
		
		this.initContext();
		
		shell.open();
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
	}
	
	public Display getDisplay() {
		return display;
	}
}
